package com.example.tutormanagement.mapper;

import com.example.tutormanagement.pojo.Profession;
import com.example.tutormanagement.pojo.Register;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface RegisterMapper {
    @Select("select * from profession_register")
    List<Register> list();

    void update(Register register); //xml映射

    void insert(Register register); //xml映射

    @Delete("delete from profession_register where pid=#{id}")
    void delete(String id);

    @Select("select * from profession_register where pid=#{id}")
    void select_row(String id);

    @Select("select profession ,count(*) as count from profession_register group by profession")
    List<Profession> count();

    List<Register> search(Register register);
}
